The present invention relates to a method of enlarging/reducing or scaling an image, and more particularly to a method of scaling an image capable of preventing disappearance of thin lines and variations of line widths. Scaling of an image is required in, for example, terminal equipments having communication image sizes different from each other.
The enlargement/reduction process of a digital image (binary level image, multi-level image) in a resampling system is generally to find which position each pixel of an enlarged/reduced image corresponds to when it is projected onto an original image (i.e., inverse mapping), and to determine a pixel value of each pixel of the enlarged/reduced image from that position and pixel values of the original image therearound. Enlarging/reducing will be referred to as scale (scaling) hereinafter for the sake of simplicity except a special case.
A basis of the scaling process of a digital image will be described with reference to FIGS. 1a and 1b.
In FIGS. 1a and 1b, a coordinate system is set with the upper left point of the image as an origin, and an x-axis and a y-axis are set in a row direction and in a column direction, respectively.
When it is assumed that scale factors in x-axis and y-axis directions are r.sub.x and r.sub.y, the coordinates (x,y) of a projected position P onto an original image of a pixel Q located at coordinates (X,Y) for a scaled image in FIG. 1a are shown as follows. EQU (x,y)=(X/r.sub.x, Y/r.sub.y)=(i.sub.x +d.sub.x, i.sub.y +d.sub.y)
Here, i.sub.x and i.sub.y are to express integral parts and d.sub.x and d.sub.y are to express fractional parts.
The position P on the original image corresponding to one pixel Q of the scaled image is surrounded by four pixels located at four coordinates (i.sub.x, i.sub.y), (i.sub.x +1, i.sub.y), (i.sub.x, i.sub.y +1) and (i.sub.x +1+i.sub.y +1) and located at distances (d.sub.x, d.sub.y) from the coordinates (i.sub.x, i.sub.y) as shown in FIG. 1b.
The process when an analog image is transformed into a digital image is referred to as sampling process, but the scaling process of a digital image is referred to as resampling process sometimes since it may be considered to sample again an image sampled once. In this case, a pixel of a scaled image is referred to as a resampling pixel, and a position projected onto an original image corresponding to the resampling pixel is referred to as a resampling position. Further, the positions of four pixels described above surrounding the resampling position are referred to as reference lattice points. Moreover, the coordinates (i.sub.x, i.sub.y) of an upper left pixel among the lattice points surrounding the resampling position are the coordinates of a reference lattice point R. Furthermore, (d.sub.x, d.sub.y) are referred to intra-lattice coordinates.
The pixel value of the pixel Q of a processed of four pixels surrounding the resampling position and the intra-lattice coordinates (d.sub.x, d.sub.y) of the resampling position or by the pixel values of four pixels surrounding the resampling position and of pixels therearound and the intra-lattice coordinates (d.sub.x, d.sub.y).
Various concrete methods of scaling an image on the basis of the process described above have been heretofore proposed.
As a conventional method of scaling with a binary level image as an object, for example, a nearest neighbor method or a selective processing conversion method, a projection method, a logical OR method or the like have been known. (See, for example, "An Analysis of Linear Density Conversion of Facsimile", the Journal of the Institute of Image Electronics Engineers of Japan, Vol. 7, No. 1, pp. 11-18, 1978).
In the nearest neighbor method, the pixel value of a pixel nearest to the resampling position is adopted as the pixel value of the resampling pixel.
In the projection method, influence areas are determined around respective pixels of the original image, respectively, and influenced areas are also determined around the resampling position, thus determining the pixel value of the resampling pixel by obtaining weighted mean of pixel values of respective pixels of the original image in accordance with the area of a location where the influenced area and the influence area overlap each other.
In the logical OR method, the pixel value of the resampling pixel is determined by logical OR of pixel values of pixels near the resampling position.
Although the nearest neighbor method and the projection method are excellent in a point that black-to-white pixel ratios of a scaled image to an original image resemble to each other, these methods have such drawbacks that the line width on the scaled image is not determined by the line width of the original image and the scale factor, but varies depending on the resampling position of the pixels which make up the line (which is referred to as line width variation), and fine lines sometimes disappear at time of a reduction process (which is referred to as thin line disappearance).
The logical OR method can prevent thin line disappearance, but cannot prevent line width variation. Furthermore, there is such a drawback that the line width on the scaled image becomes thicker than a line width determined theoretically by the line width of the original image and the scale factor and blurring (disappearance of white area located between black areas) is easily produced, thus being liable to give rise to deterioration of image quality.
Besides, a scaling method in which a function of detecting thin lines disappearing at time of reduction and preventing disappearance thereof is added to the nearest neighbor method or the projection method has been proposed lately in, for example, JP-A-1-80167 (laid open on Mar. 27, 1989) entitled "Method of Reducing and Transforming an Image", an article entitled "Reduction method of bi-level image with thin line preservation", IECE (the Institute of Electronics, Information and Communication Engineers) Fall Conference '89, D-86, 1989, and an article entitled "Fine line preservation algorithm of reduction for bi-level images", IECE Spring Conference '90, D-447, 1990.
In these scaling methods, however, no consideration is given as to prevent line width variation.
FIGS. 2a and 2b show an example of line width variation produced by image reduction process in case the scale factor in the row direction and the column direction is 1/1.3. An example of the relationship between the original image and the resampling position is shown in FIG. 2a. A white circle indicates a pixel having a pixel value of "white" (a white pixel), a black circle indicates a pixel having a pixel value of "black" (a black pixel), and a mark X indicates a resampling position. A reduced image is shown in FIG. 2b. The nearest neighbor method is applied in this example, but other methods are also applicable in like manner. As it is apparent from these figures, two lines which had the same width in the original image have been transformed into two lines having different widths in the reduced image.